#include "Tps929120_PBCfg.h"



const TpsCom_UserCfg_t g_cstTpsComUserCfg[UART_COM_NUM]=
{
		[COM_LPUART0]={.u8CanPHYFlag  = TRUE},
};


const TpsDriver_UserCfg_t g_cstTpsDrvUserCfg[DRIVER_CHIP_NUM]=
{
		[TPS_CHIP_ADD_0]={.u8DevAddr = 0, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_1]={.u8DevAddr = 1, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_2]={.u8DevAddr = 2, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0x3FF},
		[TPS_CHIP_ADD_3]={.u8DevAddr = 3, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_4]={.u8DevAddr = 4, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_5]={.u8DevAddr = 5, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_6]={.u8DevAddr = 6, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_7]={.u8DevAddr = 7, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_8]={.u8DevAddr = 8, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFFF},
		[TPS_CHIP_ADD_9]={.u8DevAddr = 9, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_10]={.u8DevAddr = 10, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_11]={.u8DevAddr = 11, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_12]={.u8DevAddr = 12, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFF},
		[TPS_CHIP_ADD_13]={.u8DevAddr = 13, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0xFFF},
		[TPS_CHIP_ADD_14]={.u8DevAddr = 14, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0x3FF},
		[TPS_CHIP_ADD_15]={.u8DevAddr = 15, .u8UartComInst=COM_LPUART0, .u16ChnlUseMask = 0x3FF},
};


void Tps_Drv_Init()
{


	Tps_CfgInit(g_cstTpsComUserCfg, UART_COM_NUM, g_cstTpsDrvUserCfg, DRIVER_CHIP_NUM);


	// Tps_BC_SetPwmReqAndRefRang(0xFF, PWM_FREQ_7800HZ, REFRANG_512);
	// Tps_BC_DisableAllChannel();

	

#if 0
	uint8_t u8ChnlLoop = 0;
	Tps_BC_SetLock(0xFF,  0);
	Tps_BC_SetCLR(0xFF,   0x03);
	Tps_BC_SetMISC4(0xFF, 0);
	Tps_BC_SetMISC0(0xFF, 0);
    Tps_BC_DisableAllChannel();
	Tps_BC_SetPwmReqAndRefRang(0xFF, PWM_FREQ_7800HZ, REFRANG_512);
	for(u8ChnlLoop=0; u8ChnlLoop<DRIVER_CHANNEL_NUM; u8ChnlLoop++)
	{
		Tps_BC_SetChannelPWMDuty(0x01, u8ChnlLoop, 0x0);
		// Tps_BC_SetChannelPWMDuty(0xFF, u8ChnlLoop, 0xFFF);
	}

	// Tps_BC_EnableAllChannel();
#endif
}
